package com.example.mongodb.mongodb.controller.rabbitmq.delayedqueue;

import lombok.extern.log4j.Log4j2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Log4j2
public class RabbitMqController {

    @Autowired
    private RabbitTemplate rabbitTemplate;


    @GetMapping("/sendMessage")
    public void sendMessage(){

        log.debug("我是debug消息：############################");

        rabbitTemplate.convertAndSend("myEx","direct.biz.ex","你好呢！！！！！");

        log.error("我是ERROR消息###################");
        log.info("我是info信息");
    }
}
